﻿using BCCommon.Enums;
using BCCommon.PaymentEnums;
using BCEntity.TMS.AgentFlowRecord;
using BCEntity.TMS.AgentWallet;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.AgentFlowRecord
{
    public interface IAgentFlowRecordData
    {
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="agentflowrecordId"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(long agentflowrecordId);
        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="agentflowrecordId"></param>
        /// <returns></returns>
        Task<AgentFlowRecordEntity> GetEntityAsync(long agentflowrecordId);
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<AgentFlowRecordEntity>, int)> GetListAsync(int pageIndex, int pageSize);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<AgentFlowRecordEntity> InsertAsync(AgentFlowRecordEntity entity);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<AgentFlowRecordEntity> UpdateAsync(AgentFlowRecordEntity entity);

        /// <summary>
        /// 获取流水记录分页信息
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="orderNo">订单编号</param>
        /// <param name="flowType">流水类型</param>
        /// <param name="flowDirection">资金流向</param>
        /// <param name="payChannel">支付渠道</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<AgentFlowRecordEntity>, int)> GetPageableList(long? agentRecordId, string orderNo, FlowType? flowType,
            FlowDirectionType? flowDirection, PaymentChannelType? payChannel, DateTime? startDate,DateTime? endDate,
            bool? ascending, int pageIndex, int pageSize);

        /// <summary>
        /// 获取流水记录分页信息
        /// </summary>
        /// <param name="flowDirectionType">流水方向</param>
        /// <param name="flowType">流水类型</param>
        /// <param name="minAmount">最小金额</param>
        /// <param name="maxAmount">最大金额</param>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<AgentFlowRecordEntity>, int)> GetAgentFlowDetails(long agentRecordId, FlowType? flowType, FlowDirectionType? flowDirectionType, decimal? minAmount,
            decimal? maxAmount, PaymentChannelType? paymentChannelType, DateTime? startDate,
            DateTime? endDate, bool? ascending, int pageIndex, int pageSize);
    }
}